Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script src="../../ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> x=0; $(document).ready(function(){ $("div").scroll(function(){ $("span").text(x+=1); }); }); </script> </head> <body> <p>Try the scrollbar in the div</p> <div style="border:1px solid black;width:200px;height:100px;overflow:scroll;">In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since. <br><br> 'Whenever you feel like criticizing anyone,' he told me, just remember that all the people in this world haven't had the advantages that you've had.'</div> <p>Scrolled <span>0</span> times.</p> </body> <!-- Mirrored from www.w3schools.com/jquery/tryit.asp?filename=tryjquery_event_scroll by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:14:55 GMT --> </html>
Result:
Try it Yourself - © w3schools.com